<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="/yzm/" method="post">
    {% csrf_token %}
    <input type="text" name="custom_input">
    <input type="hidden" name="hash_key" id="key1">
    <img src="" alt="" id="img1"> <br>
    <input type="submit" value="提交">
</form>
</body>
</html>
<script src="/static/plugin/jquery/jquery-3.3.1.min.js"></script>
<script>
    $(function (){
        $.get("/generate/",function(result){
            console.log(result)
            $("#img1").attr("src",result["image_url"])
            $("#key1").attr("value",result["key"])
        })
    })
</script>